//
//  LCShowComposeViewCell.swift
//  JKBiblicalReading
//
//  Created by admin on 2018/8/20.
//  Copyright © 2018年 LC. All rights reserved.
//

import UIKit

// 自定义LCShowComposeViewCell
class LCShowComposeViewCell: LCShowComposeViewNoImagesCell {
    

    //FIXME:- 上午10:29 设置视图
    ///设置视图
    override func setupUI(){
        //        backgroundColor = randomColor()//UIColor(white: 235 / 255, alpha: 1)
        contentView.addSubview(authorImageView)
        authorImageView.snp.makeConstraints { (make) in
            make.left.top.equalTo(contentView).offset(15)
            make.width.height.equalTo(55)
        }
        contentView.addSubview(usernameButton)
        contentView.addSubview(followButton)
        usernameButton.snp.makeConstraints { (make) in
            make.top.equalTo(self.authorImageView.snp.top)
            make.left.equalTo(self.authorImageView.snp.right).offset(15)
            make.height.equalTo(30)
            make.right.equalTo(self.followButton.snp.left).offset(0)
        }
        followButton.snp.makeConstraints { (make) in
            make.top.equalTo(usernameButton.snp.top)
            make.right.equalTo(contentView.snp.right).offset(-20)
            make.height.equalTo(22)
            make.width.equalTo(46)
        }
        
        contentView.addSubview(addtimeButton)
        addtimeButton.snp.makeConstraints { (make) in
            make.top.equalTo(self.usernameButton.snp.bottom)
            make.left.equalTo(self.usernameButton.snp.left).offset(0)
//            make.right.equalTo(contentView.snp.right).offset(-15)
        }
        
        contentView.addSubview(contentLabel)
        contentLabel.snp.makeConstraints { (make) in
            make.top.equalTo(authorImageView.snp.bottom).offset(15)
            make.left.equalTo(usernameButton.snp.left).offset(0)
            make.right.equalTo(contentView.snp.right).offset(-15)
            make.height.equalTo(contentLabel.snp.height)
        }
        
        contentView.addSubview(showComposePictureView)
        showComposePictureView.snp.makeConstraints { (make) in
            make.top.equalTo(contentLabel.snp.bottom).offset(15)
            make.left.equalTo(self.contentLabel).offset(0)
            make.right.equalTo(self.contentLabel).offset(0)
            make.height.equalTo((ScreenWidth - 10) / 4)
//            make.size.equalTo(CGSize(width: (ScreenWidth - 20) * 0.75, height: (ScreenWidth - 20) / 4))
        }
        
        contentView.addSubview(pingLunButton)
        pingLunButton.snp.makeConstraints { (make) in
            make.top.equalTo(showComposePictureView.snp.bottom).offset(15)
            make.left.equalTo(usernameButton.snp.left).offset(0)
            make.width.greaterThanOrEqualTo(65)
        }
        contentView.addSubview(zanButton)
        zanButton.snp.makeConstraints { (make) in
            make.top.equalTo(pingLunButton.snp.top).offset(0)
            make.left.equalTo(pingLunButton.snp.right).offset(20)
            make.width.greaterThanOrEqualTo(65)
        }
        contentView.addSubview(举报Button)
        举报Button.snp.makeConstraints { (make) in
            make.top.equalTo(pingLunButton.snp.top).offset(0)
            make.right.equalTo(contentView.snp.right).offset(-20)
        }
        
        let margin: CGFloat = 20
        
        self.setupAutoHeight(withBottomView: zanButton, bottomMargin: margin)
            
    }

}
